package com.bicon.botu.mall.goods.api;

import com.bicon.botu.mall.goods.service.NoticeOfReductionService;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * 降价通知移动端
 *
 * @Author 刘齐
 * @Date 2017/7/25 10:29
 */
@Slf4j
@RestController
@RequestMapping("/V1.0.0/api/NoticeOfReductionApi")
public class NoticeOfReductionApi extends BaseController {
    //降价通知Service接口
    @Autowired
    NoticeOfReductionService noticeOfReductionService;

    /**
     * 降价通知ServiceImpl
     *
     * @param userId             用户ID
     * @param productRepertoryId 产品库存ID
     * @param hopePrice          期望价格
     * @param notice             短信通知 0:通知 1：不通知
     * @return
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public BaseResult save(@RequestParam String userId,
                           @RequestParam String productRepertoryId,
                           @RequestParam BigDecimal hopePrice,
                           @RequestParam String notice) {
        return noticeOfReductionService.save(userId, productRepertoryId, hopePrice, notice);
    }

}
